/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model.kruskal;

import model.Point;

/**
 *
 * @author Vlada
 */
public class KruskalObject implements Comparable<KruskalObject>{
    
    private Point point1;
    private Point point2;
    private double distanceBetweenPoints;
   

    /**
     * @return the point1
     */
    public Point getPoint1() {
        return point1;
    }

    /**
     * @param point1 the point1 to set
     */
    public void setPoint1(Point point1) {
        this.point1 = point1;
    }

    /**
     * @return the point2
     */
    public Point getPoint2() {
        return point2;
    }

    /**
     * @param point2 the point2 to set
     */
    public void setPoint2(Point point2) {
        this.point2 = point2;
    }

    /**
     * @return the distanceBetweenPoints
     */
    public double getDistanceBetweenPoints() {
        return distanceBetweenPoints;
    }

    /**
     * @param distanceBetweenPoints the distanceBetweenPoints to set
     */
    public void setDistanceBetweenPoints(double distanceBetweenPoints) {
        this.distanceBetweenPoints = distanceBetweenPoints;
    }

   
    @Override
//    Compare list items by distance
    public int compareTo(KruskalObject k) {

        double comparedSize = k.distanceBetweenPoints;
		if (this.distanceBetweenPoints > comparedSize) {
			return 1;
		} else if (this.distanceBetweenPoints == comparedSize) {
			return 0;
		} else {
			return -1;
		}
    }
    
}
